package cn.yhjz.admin.biz.controller;

import cn.yhjz.admin.biz.service.impl.PersonServiceImpl;
import cn.yhjz.common.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {
    @Autowired
    private PersonServiceImpl personService;

    @RequestMapping("/index")
    @ResponseBody
    public String index() {
        return "hello world";
    }

    @RequestMapping("/index2")
    @ResponseBody
    public String index2() {
        return "hello world22222";
    }

    @RequestMapping(value = "/exception")
    public String testException() {
        throw new RuntimeException("RuntimeException");
    }

    @RequestMapping("/serviceException")
    @ResponseBody
    public String testServiceException() {
        throw new ServiceException("ServiceException");
    }
}
